<?php /* Smarty version 2.6.21, created on 2012-12-03 23:52:15
         compiled from ArrangeTables.tpl.html */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<script   language="javascript" src="js/ArrangeTables.js">
<!--




//-->
</script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Arrange Tables</title>
</head>
	
<body>
<div align="center">
<form action="arrangeColumnAttributes.php" method="post" name="form1" id="form1" onsubmit="test();">
<table width="800" border="0">
  <tr>
      <td width="80">
      </td>
      <td width="90%">
          <table border="1" width="100%">
              <tr>
                <td width="50%">   
                     Table Name
                </td>
                <td width="50%">Alias Name (will be used as head of attributes)</td>
               </tr>
          </table>
      </td>
    
  </tr>

<?php $_from = $this->_tpl_vars['tempTables']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['foo'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['foo']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['ttt']):
        $this->_foreach['foo']['iteration']++;
?>
 
  
  <?php if ($this->_tpl_vars['ttt']->flag == 0): ?> 
  <tr bgcolor="#CC99FF"> 
    <td>Table setting:
  </td>
  <td width="100%">
  <table width="100%" border="1" >
  <tr>
    <td width="50%"> 
   
     <label>
      <select name="tables<?php echo $this->_tpl_vars['ttt']->index; ?>
" id="tables<?php echo $this->_tpl_vars['ttt']->index; ?>
">
      <?php $_from = $this->_tpl_vars['tables']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['ind'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['ind']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['tn']):
        $this->_foreach['ind']['iteration']++;
?>
        <option value="<?php echo $this->_tpl_vars['tn']->tableName; ?>
" <?php if ($this->_tpl_vars['ttt']->index == ($this->_foreach['ind']['iteration']-1)): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['tn']->tableName; ?>
</option> 
        <?php endforeach; endif; unset($_from); ?>
      </select>
    </label></td>
    <td width="50%"><input name="aliasName<?php echo $this->_tpl_vars['ttt']->index; ?>
" type="text" value="<?php if ($this->_foreach['foo']['total'] > 1): ?>t<?php echo $this->_tpl_vars['ttt']->index; ?>
<?php else: ?><?php endif; ?>"/></td>
  </tr>
  </table>
  <?php else: ?>
  <tr bgcolor="#99FF00">
  <td>Join setting: 
  </td>
  <td width="100%">
  <table width="100%" border="1" >
  <tr>
  <td>
  <input name="join<?php echo $this->_tpl_vars['ttt']->index; ?>
_method" type="text" value="join" size="8" /></td>
  <td width="50%">
  <select name="join<?php echo $this->_tpl_vars['ttt']->index; ?>
_table1" onchange="javascript:updateTable('join<?php echo $this->_tpl_vars['ttt']->index; ?>
_column1',this.value);">
          <?php $_from = $this->_tpl_vars['tables']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['ind'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['ind']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['tn']):
        $this->_foreach['ind']['iteration']++;
?>
        <option value="<?php echo $this->_tpl_vars['tn']->tableName; ?>
" <?php if ($this->_tpl_vars['ttt']->tables[0] == $this->_tpl_vars['tn']->tableName): ?>selected<?php endif; ?>="selected"><?php echo $this->_tpl_vars['tn']->tableName; ?>
</option> 
        <?php endforeach; endif; unset($_from); ?>
  </select>
  <select name="join<?php echo $this->_tpl_vars['ttt']->index; ?>
_column1" id="join<?php echo $this->_tpl_vars['ttt']->index; ?>
_column1">
  </select>
  <script language="javascript">updateTable('join<?php echo $this->_tpl_vars['ttt']->index; ?>
_column1','<?php echo $this->_tpl_vars['ttt']->tables[0]; ?>
')</script>
  </td>
  <td width="30">
  <select name="join<?php echo $this->_tpl_vars['ttt']->index; ?>
_operation">
	<option  value="=" selected="selected">=</option>
	<option value="&gt;">&gt;</option>
	<option value="&lt;">&lt;</option>
	<option value="&gt;=">&gt;=</option>
	<option value="&lt;=">&lt;=</option>
  </select>
  </td>
  <td width="50%">
  <select name="join<?php echo $this->_tpl_vars['ttt']->index; ?>
_table2" onchange="javascript:updateTable('join<?php echo $this->_tpl_vars['ttt']->index; ?>
_column1',this.value);">
          <?php $_from = $this->_tpl_vars['tables']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['ind'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['ind']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['tn']):
        $this->_foreach['ind']['iteration']++;
?>
        <option value="<?php echo $this->_tpl_vars['tn']->tableName; ?>
" <?php if ($this->_tpl_vars['ttt']->tables[1] == $this->_tpl_vars['tn']->tableName): ?>selected<?php endif; ?>="selected"><?php echo $this->_tpl_vars['tn']->tableName; ?>
</option> 
        <?php endforeach; endif; unset($_from); ?>
  </select>
  <select name="join<?php echo $this->_tpl_vars['ttt']->index; ?>
_column2" id="join<?php echo $this->_tpl_vars['ttt']->index; ?>
_column2">
  </select>
  <script   language="javascript">updateTable('join<?php echo $this->_tpl_vars['ttt']->index; ?>
_column2','<?php echo $this->_tpl_vars['ttt']->tables[1]; ?>
')</script>
  </td>

  </tr>
  </table>
  <?php endif; ?>
  </td>
  </tr>
  <?php endforeach; endif; unset($_from); ?>
</table>


    
      <label>Middle Words between table and attribute
        <input name="middleWord" type="text" id="middleWord" value="_" />
      </label>
    
    
      <label>
<input name="button" type="submit" id="button"  value="Submit" onclick= "javascript:return CheckForm();" />
      </label>
    
    
      <input name="totalTableSize" type="hidden" value="<?php echo $this->_tpl_vars['tableSize']; ?>
" />
  
</form>
</div>
<br />
<br /></body>
</html>